﻿<phone:PhoneApplicationPage 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="728"
	x:Class="EMOe.Categories"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Orientation="Portrait"
	shell:SystemTray.IsVisible="False" Background="Black">
	<phone:PhoneApplicationPage.Foreground>
		<SolidColorBrush Color="White"/>
	</phone:PhoneApplicationPage.Foreground>
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar BackgroundColor="Black" ForegroundColor="White">
			<shell:ApplicationBarIconButton x:Name="okIcon" IconUri="/icons/appbar.check.rest.png" Text="OK" Click="okIcon_Click"/>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot">
		<Grid.Background>
			<ImageBrush Stretch="Fill" ImageSource="BackGroundCategories.png"/>
		</Grid.Background>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		
		<!--TitlePanel contains the name of the application and page title-->
		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,79,0,28">
			<TextBlock x:Name="PageTitle" Text="Categories" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Foreground="#DEFFFFFF"/>
		</StackPanel>

		<!--ContentPanel - place additional content here-->
		<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,-16,12,0" Loaded="ContentPanel_Loaded">
			<ListBox x:Name="lstCategories" SelectionChanged="lstCategories_SelectionChanged" Foreground="White">
        		<ListBox.ItemTemplate>
        			<DataTemplate>
        				<toolkit:ToggleSwitch  Header="{Binding cateName}" IsChecked="{Binding cateSet}" Margin="30,0,0,0" Width="420" Checked="ToggleSwitch_Checked" Unchecked="ToggleSwitch_Unchecked">
        					 <toolkit:ToggleSwitch.HeaderTemplate>
						        <DataTemplate>
						            <ContentControl FontSize="{StaticResource PhoneFontSizeLarge}" Foreground="#DEFFFFFF" Content="{Binding}"/>
						        </DataTemplate>
						    </toolkit:ToggleSwitch.HeaderTemplate>
						    <toolkit:ToggleSwitch.ContentTemplate>
						        <DataTemplate>
						            <StackPanel>
						                <StackPanel Orientation="Horizontal">
						                    <ContentControl HorizontalAlignment="Left" FontSize="{StaticResource PhoneFontSizeSmall}" Content="{Binding}" Foreground="#DEFFFFFF"/>
						                </StackPanel>
						            </StackPanel>
						        </DataTemplate>
						    </toolkit:ToggleSwitch.ContentTemplate>
        				</toolkit:ToggleSwitch>		   			   			
					</DataTemplate>      		
				</ListBox.ItemTemplate>
			</ListBox>
		</Grid>
	</Grid>
</phone:PhoneApplicationPage>